package com.chenyongjing.design.pattern.composite.demo.safe;

/**
 * 安全模式写法
 */
public class Test {
    public static void main(String[] args) {
        File qq = new File("QQ.exe");
        File wx = new File("微信.exe");
        Folder office = new Folder("办公软件",2);

        File word = new File("Word.exe");
        File excel =new File("Excel.exe");
        File ppt = new File("ppt.exe");

        office.add(word);
        office.add(excel);
        office.add(ppt);

        Folder root = new Folder("D",1);
        root.add(office);
        root.add(qq);
        root.add(wx);
        root.show();

    }

}
